﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace Campus {
    class DownByTheRiver : Structure {
        static public Texture2D BuildingTexture { get; private set; }
        static public Texture2D StaticTeamColorTexture { get; private set; }
        static public Texture2D ConstructionTexture { get; private set; }
        static public Vector2 StaticOrigin { get; private set; }
        static public List<Vector2> StaticTilesOccupied { get; private set; }
        static public void InitializeTextures(ContentManager Content) {
            BuildingTexture = Content.Load<Texture2D>("Structures/building_river_base");
            StaticTeamColorTexture = Content.Load<Texture2D>("Structures/building_river_team");
            ConstructionTexture = Content.Load<Texture2D>("Structures/building_river_build");
            StaticOrigin = new Vector2(28, 140);
            // Set up the tiles that get turned into walls when this building is placed.
            StaticTilesOccupied = new List<Vector2>();
            StaticTilesOccupied.Add(new Vector2(0, 0));  // Tile this building is placed on.
            StaticTilesOccupied.Add(new Vector2(0, 1));
            StaticTilesOccupied.Add(new Vector2(0, 2));
            StaticTilesOccupied.Add(new Vector2(1, 0));
            StaticTilesOccupied.Add(new Vector2(1, 1));
            StaticTilesOccupied.Add(new Vector2(1, 2));
            StaticTilesOccupied.Add(new Vector2(2, 0));
            StaticTilesOccupied.Add(new Vector2(2, 1));
            StaticTilesOccupied.Add(new Vector2(2, 2));
            StaticTilesOccupied.Add(new Vector2(3, 0));
            StaticTilesOccupied.Add(new Vector2(3, 1));
            StaticTilesOccupied.Add(new Vector2(3, 2));
            StaticTilesOccupied.Add(new Vector2(0, 3));
            StaticTilesOccupied.Add(new Vector2(1, 3));
            StaticTilesOccupied.Add(new Vector2(2, 3));
            StaticTilesOccupied.Add(new Vector2(3, 3));
        }

        private void CreateAbilities() {
            Abilities.Add("Build Mini bus", new BuildUnitAbility(MenuIcons.BuildCampusShuttleIcon, this, BuildRequirements.Units.CampusShuttle));
        }
        public DownByTheRiver(Player player, Level level)
            : base(BuildingTexture, StaticTeamColorTexture, ConstructionTexture, StaticTilesOccupied, StaticOrigin, Vector2.Zero, 500, player, level, new Dictionary<String, Ability>(), new Dictionary<string,AbilitySubMenu>())
        {
            m_name = "Down by the River";
            CreateAbilities();

            // TODO: Create Nexus Abilities / Submenus

        }
        protected override void Destroy()
        {
            base.Destroy();
        }
        public override string ToString()
        {
            string returnString = m_name + "\n" +
                                  "HP: " + m_currentHP + "/" + m_maxHP + "\n" + 
                                  "Down by the River produces Mini busses.";
            return returnString;
        }
        public override void Update(Player player)
        {
        }
    }
}
